/*============================================================================*/
/*                                                                            */
/*  FILE       : logfile.h                                                    */
/*  CONTENTS   : Header for log file support.                                 */
/*----------------------------------------------------------------------------*/
/*    $Archive:: /Software/mbapi/release/include/fileio/LOGFILE.H            $*/
/*   $Revision:: 81                                                          $*/
/*----------------------------------------------------------------------------*/
/*  VISIBILITY : Private                                                      */
/*               Copyright (c) 1998 Motionbase (Holdings) Ltd.                */
/*               All rights reserved.                                         */
/*               This software is disclosed in the strictest commercial       */
/*               confidence and on the understanding that no part thereof is  */
/*               to be presented or divulged to any other party or copied,    */
/*               reproduced, distributed or stored in a retrieval system      */
/*               without the prior express written permission of              */
/*               Motionbase (Holdings) Ltd.                                   */
/*----------------------------------------------------------------------------*/
/*  HISTORY    :                                                              */
/*                                                                            */
/*    Date     Author    Description                                          */
/*  19/05/98     KG      Created                                              */
/*  19/05/99     KG      Added CCONV modifier to export functions from DLL.   */
/*============================================================================*/
#ifndef _LOGFILE_H_
#define _LOGFILE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "comp_def.h"

/*============================================================================*/
/* INCLUDES                                                                   */
/*============================================================================*/

/*============================================================================*/
/* GLOBAL FUNCTION PROTOTYPES                                                 */
/*============================================================================*/
/*----------------------------------------------------------------------------*/
/* closeLogFile                                                               */
/* Closes the previously opened log file.                                     */
/*                                                                            */
/* Args:                                                                      */
/* None.                                                                      */
/*                                                                            */
/* Return:                                                                    */
/* None                                                                       */
/*----------------------------------------------------------------------------*/
CCONV VOID closeLogFile (VOID);

/*----------------------------------------------------------------------------*/
/* deleteLogFiles                                                             */
/* Deletes old log files before a given date.                                 */
/* A cut off date is supplied via the day, month and year parameters.  The    */
/* function searches a specified directory for log files whose file name      */
/* represents a date equal to or older than the date provided. Any such files */
/* found are deleted.  The number of files deleted is returned.               */
/*                                                                            */
/* Args:                                                                      */
/* pPath -   The search directory.  Must end in '\'.                          */
/* day   -+  These three integers specify the day (1..31), month (1..12) and  */
/* month -+- year (00..99) of the most recent log files that should be        */
/* year  -+  deleted.                                                         */
/*                                                                            */
/* Return:                                                                    */
/* The number of files deleted.                                               */
/*----------------------------------------------------------------------------*/
CCONV INT deleteLogFiles (CHAR* pPath, INT day, INT month, INT year);

/*----------------------------------------------------------------------------*/
/* openNewLogFile                                                             */
/* Creates and opens a new log file in the directory specified.               */
/*                                                                            */
/* Args:                                                                      */
/* pPath - Path to the directory in which the log file will be created.       */
/*         Must end in '\'.                                                   */
/*                                                                            */
/* Return:                                                                    */
/* 0 - unable to open the file.                                               */
/* 1 - a new file was opened.                                                 */
/*----------------------------------------------------------------------------*/
CCONV INT openNewLogFile (CHAR* pPath);

/*----------------------------------------------------------------------------*/
/* writeLogFileEntry                                                          */
/* Writes some text to a log file that has previously been opened for writing.*/
/* The current date and time is written before the text provided.  The date   */
/* is written in the form DD/MM/YY.                                           */
/*                                                                            */
/* Args:                                                                      */
/* pText - character string containing the text to be written.                */
/*                                                                            */
/* Return:                                                                    */
/* None                                                                       */
/*----------------------------------------------------------------------------*/
CCONV VOID writeLogFileEntry (CHAR* message);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _LOGFILE_H_ */
/*============================================================================*/
/* END OF FILE                                                                */
/*============================================================================*/
